#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>


int main()
{
    pid_t pid = fork();
    if(pid==0)
    {
        printf("i am child process,pid:%d\n",getpid());
        sleep(5);
        exit(1);
    }
    int status = 0;
    waitpid(-1,&status,0);
    printf("exit code:%d,coredump:%d,signal code:%d\n",(status>>8)&0xFF,status&0x80,status&0x7F);
    return 0;
}
